package com.crm.model.pojo;

import java.io.Serializable;
import javax.persistence.*;

import com.fasterxml.jackson.annotation.JsonIgnore;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;


/**
 * The persistent class for the quotation_record database table.
 * 
 */
@Entity
@Table(name="quotation_record")
@NamedQuery(name="QuotationRecord.findAll", query="SELECT q FROM QuotationRecord q")
public class QuotationRecord implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	@Column(name="qd_recordId")
	private Integer qdRecordId;//报价记录id

	@Column(name="delivery_instructions")
	private String deliveryInstructions;//交付说明

	@Column(name="general_quotation")
	private BigDecimal generalQuotation;//总报价

	@Column(name="payment_instructions")
	private String paymentInstructions;//付款说明

	@Temporal(TemporalType.DATE)
	@Column(name="qr_date")
	private Date qrDate;//总报价

	@Column(name="qr_explain")
	private String qrExplain;//包装运输说明

	@Column(name="qr_offeror")
	private Integer qrOfferor;//报价人

	@Column(name="qr_offerphone")
	private String qrOfferphone;//报价人联系方式

	@Column(name="qr_receiver")
	private Integer qrReceiver;//接收人

	@Column(name="qr_theme")
	private String qrTheme;//主题

	@Lob
	@Column(name="quotation_file")
	private String quotationFile;//上传附件

	@Column(name="quotation_no")
	private Integer quotationNo;//报价单号

	private Integer state;//状态,审批

	//bi-directional many-to-one association to QuotationDetail
	@JsonIgnore
	@OneToMany(mappedBy="quotationRecord")
	private List<QuotationDetail> quotationDetails;//报价明细

	//bi-directional many-to-one association to Customer
	@ManyToOne
	@JoinColumn(name="cust_id")
	private Customer customer;//客户

	//bi-directional many-to-one association to SalesOpportunity
	@ManyToOne
	@JoinColumn(name="sal_id")
	private SalesOpportunity salesOpportunity;//销售机会

	public QuotationRecord() {
	}


	public Integer getQdRecordId() {
		return qdRecordId;
	}


	public void setQdRecordId(Integer qdRecordId) {
		this.qdRecordId = qdRecordId;
	}


	public String getDeliveryInstructions() {
		return this.deliveryInstructions;
	}

	public void setDeliveryInstructions(String deliveryInstructions) {
		this.deliveryInstructions = deliveryInstructions;
	}

	public BigDecimal getGeneralQuotation() {
		return this.generalQuotation;
	}

	public void setGeneralQuotation(BigDecimal generalQuotation) {
		this.generalQuotation = generalQuotation;
	}

	public String getPaymentInstructions() {
		return this.paymentInstructions;
	}

	public void setPaymentInstructions(String paymentInstructions) {
		this.paymentInstructions = paymentInstructions;
	}

	public Date getQrDate() {
		return this.qrDate;
	}

	public void setQrDate(Date qrDate) {
		this.qrDate = qrDate;
	}

	public String getQrExplain() {
		return this.qrExplain;
	}

	public void setQrExplain(String qrExplain) {
		this.qrExplain = qrExplain;
	}

	public Integer getQrOfferor() {
		return this.qrOfferor;
	}

	public void setQrOfferor(Integer qrOfferor) {
		this.qrOfferor = qrOfferor;
	}

	public String getQrOfferphone() {
		return this.qrOfferphone;
	}

	public void setQrOfferphone(String qrOfferphone) {
		this.qrOfferphone = qrOfferphone;
	}



	public Integer getQrReceiver() {
		return qrReceiver;
	}

	public void setQrReceiver(Integer qrReceiver) {
		this.qrReceiver = qrReceiver;
	}

	public String getQrTheme() {
		return this.qrTheme;
	}

	public void setQrTheme(String qrTheme) {
		this.qrTheme = qrTheme;
	}

	public String getQuotationFile() {
		return this.quotationFile;
	}

	public void setQuotationFile(String quotationFile) {
		this.quotationFile = quotationFile;
	}

	public Integer getQuotationNo() {
		return this.quotationNo;
	}

	public void setQuotationNo(Integer quotationNo) {
		this.quotationNo = quotationNo;
	}

	public Integer getState() {
		return this.state;
	}

	public void setState(Integer state) {
		this.state = state;
	}

	public List<QuotationDetail> getQuotationDetails() {
		return this.quotationDetails;
	}

	public void setQuotationDetails(List<QuotationDetail> quotationDetails) {
		this.quotationDetails = quotationDetails;
	}

	public QuotationDetail addQuotationDetail(QuotationDetail quotationDetail) {
		getQuotationDetails().add(quotationDetail);
		quotationDetail.setQuotationRecord(this);

		return quotationDetail;
	}

	public QuotationDetail removeQuotationDetail(QuotationDetail quotationDetail) {
		getQuotationDetails().remove(quotationDetail);
		quotationDetail.setQuotationRecord(null);

		return quotationDetail;
	}

	public Customer getCustomer() {
		return this.customer;
	}

	public void setCustomer(Customer customer) {
		this.customer = customer;
	}

	public SalesOpportunity getSalesOpportunity() {
		return this.salesOpportunity;
	}

	public void setSalesOpportunity(SalesOpportunity salesOpportunity) {
		this.salesOpportunity = salesOpportunity;
	}

}